package com.example.myapplication.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.example.myapplication.R;
import com.example.myapplication.bean.ClassMateListBean;

import java.util.List;

public class ClassMateListAdapter extends BaseAdapter {
    List<ClassMateListBean.DataDTO> data;
    Context mContext;

    public ClassMateListAdapter(List<ClassMateListBean.DataDTO> data, Context mContext) {
        this.data = data;
        this.mContext = mContext;
    }

    @Override
    public int getCount() {
        return data.size();
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        LayoutInflater inflater = LayoutInflater.from(mContext);
        View view = inflater.inflate(R.layout.studentitem,null);
        TextView tv = view.findViewById(R.id.tv_student_item);
        tv.setText(data.get(position).getName());
        tv.setTextSize(36);
        return view;
    }
}
